﻿using BCDto.TMS.Contraband.ContrabandCategory;
using BCService.TMS.Contraband.ContrabandCategory;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace BCTMSRESTful.Controllers.ClientApp.Contraband
{
    /// <summary>
    /// 违禁品分类
    /// </summary>
    [Route("api/v1/ClientApp/[controller]")]
    [ApiExplorerSettings(GroupName = "ClientApp")]
    [AllowAnonymous]
    public class ContrabandCategoryController : ClientAppBaseController
    {
        private readonly IContrabandCategoryService contrabandCategoryService;

        public ContrabandCategoryController(IContrabandCategoryService contrabandCategoryService)
        {
            this.contrabandCategoryService = contrabandCategoryService;
        }

        /// <summary>
        /// 查询违禁品分类列表
        /// </summary>
        /// <param name="contrabandCategory">违禁品分类</param>
        /// <response code="200">查询违禁品分类列表</response>
        /// <returns></returns>
        [HttpGet("[action]")]
        [ProducesResponseType(typeof(IEnumerable<ContrabandCategoryDto>), 200)]
        public IActionResult List([FromQuery(Name = "contraband_category")] string contrabandCategory)
        {
            var result = this.contrabandCategoryService.GetList(null, contrabandCategory);
            return this.Ok(result);
        }
    }
}
